/**
  * Author: Mei
  * Date: 2020-12-30 19:13
  * Description: 获取tuple的参数类型
  *
  *
  */
#include "../head.h"

template<typename T>
void print1(T a) {
    cout << a << endl;
}
template<typename T, typename ...Args>
void print1(T b, Args&&... c) {
    cout << b << endl;
    print1(c...);
}

template<int... a>
struct IndexTuple { //一个中介  用来得到tuple所有的索引
    print() {
        print1(a...);
    }
};

template<int N, int ... Indexes>
struct make_index : make_index<N - 1, Indexes..., N - 1> {

};
template<int ... indexes>
struct make_index<0, indexes...> {
    typedef IndexTuple<indexes...> type;
};

int main() {
    make_index<5>::type().print();
    //print1(1, 2, 3, 'a', 10);

    return 0;
}